-
-
Notifications
You must be signed in to change notification settings - Fork 347
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Internationalize the GUI #2749
Internationalize the GUI #2749
Conversation
Wow, nice! Did you use the VisualStudio functionality to move all the strings? |
I used Atom and my mouse to move all the strings 🤕, but I based the changes on a demo from Microsoft, so it should match up with how VS would do it: As for a Deutsch PR, either way is fine with me. I'd be happy to include it here or add it later. |
Wow, that must have been a lot of work. |
Just an idea: What about an option to set the language manually? Can imagine some people wanting it. And a FYI: You can set the localization yourself in the code if you add those 3 lines (found here) as early as possible (before any localized strings are loaded), e.g. right at the start of
If you want to test the German translation for example later on. If you found a better way to do this, I'm all ears. |
That was exactly how I did it. :) Except I only set one of those. |
Wow, massive piece of work there, @HebaruSan! Is this ready for our point release, or shall we leave it for the next one? |
I think it's pretty safe. If there are bugs, they should be of the "this dialog has a strange string here" variety rather than crashes or corrupted installs. |
Can somebody by any chance tell me, why my tranlations work when compiling in VisualStudio (2019), but not when when compiling with the BuildTools (15) installed without VS on Windows, nor when compiling on Linux with mono? And btw, does anybody know how to prevent VS from overwriting all the auto-generated comments? |
Sorry, forgot an important bit: The normal 'per form' translations work perfectly fine, just the translations of |
Oh that's probably due to mono/mono#12643.
Well, it does say 'favourites' on my system (with en-US)... |
BTW, in case it's useful, my command for testing on Linux is: LC_ALL=de_DE _build/ckan.exe |
Huh, you're right. I have a local build of mono's current HEAD (which includes that PR), and it works there: |
My "favourites" test was on my branch, to establish a baseline of whether there's a known-working version here. I'm checking your branch now. |
This is where Can you revert all your changes to that file? You should be able to use my version without changes. |
I recognize the issues I fixed ;)
Thanks, that might be easier than hardcoding the CultureInfo manually and recompile. Just Windows doesn't offer an option, as always. |
Oh nice! I didn't even think to check if that was you. 😆 Congrats on getting that merged! |
Will try, thanks 🎉. |
Please do, I won't be making changes to your branch. |
Regarding the
That's wrong it seems, since I run Why is this bug a problem for us/me?
for easy centering in every language. A workaround/how it was before: Set the location of every link label for every language (by now only two for this form) manually so they appear centered (which is very fiddly to do!). |
Okay, I just found out that the icon problem is not introduced by our changes! |
This issue is unreal! There's nothing different in how we treat that object, but that effect is completely consistent and persistent no matter what changes I make. ... I think we're looking at a one-in-a-million Mono bug related to the exact pixel length of the resource string. I tried changing it to "afsdkamjsldk fdjklpa" (same number of characters with same grouping, but the letters aren't the exact same width) and it started working normally. But as long as the exact text is "Empfehlungen ansehen", it goes weird. Can you think of a slightly different translation for that string? |
"Empfehlungen installierter Mods", translated to "Recommendations of installed mods" should fit well. |
So we're all good to merge this, now? Are we sure those weird alignment errors don't appear with different app window sizes, or something like that? |
@HebaruSan needs to rebase once more for #2762.
I don't remember if I tried resizing the window, but I doubt that would affect the issue. Resizing the dropdown menu at least didn't fix it. So after the rebase you have a Go from my side 👍. |
Rebased!
I decided the English string sounded better without GameData. Does "Durchsuche nach DLCs und manuell installierten Modulen..." make sense? |
"Suche nach DLCs und manuell installierten Modulen..." (without the "Durch") would be a bit more natural. |
@politas, yes, this is ready now. I haven't merged it because I wasn't sure whether to count it as "reviewed" given that both @DasSkelett and I have made commits to the branch. |
No, resizing the window does indeed nothing. Would have been weird, because I'm sure @HebaruSan doesn't use the exact same window size, and it happened on his system too. |
Is it possible to add the translation files into a separate folder like |
Good idea. Rebased to get the NuGet updates and moved those to a Localization/de-DE folder. I couldn't figure out how to make it work with Resources.de-DE.resx, but those are already in the Properties folder so that shouldn't be as much of a problem. |
For me this is good to merge. If nobody finds any alignment errors anymore for the German translation, this can be merged. |
Motivations
Changes
.Designer.cs
files are moved into the corresponding.resx
files and set viaresources.ApplyResources
.Properties/Resources.resx
and accessed viaProperties.Resources.NameOfString
..en-US.resx
files are added as needed to switch to American spellings for American users.SingleAssemblyResourceManager
andSingleAssemblyComponentResourceManager
extend the built in resource manager classes to support bundled satellite assemblies.Now when a UK/Aussie user opens the CKAN GUI, they'll see familiar extra "u"s and words ending in "ise", while Americans will see no extra "u"s and words ending in "ize".
German translation
@DasSkelett has translated the entire GUI into German!
Erfolg!
Icons and exe size
While poking around at our resource files, @DasSkelett discovered that we have 11 copies of the CKAN icon (roughly one per form), and that each one takes up something like 700 KiB, adding up to fully half the size of the compiled exe!!
Now these are moved from the forms' resx files to the project resx file, where one copy is shared. This makes
ckan.exe
less than half the size it was previously, while working exactly the same.Known limitations
Only GUI is updated! This PR doesn't touch Core (but a future one might). Lots of visible strings come from Core, but the ones from GUI should all be localizable.